<?php

namespace app\modules\clinical\models;

use Yii;

/**
 * This is the model class for table "excel_hsp".
 *
 * @property integer $pk_id
 * @property integer $pt_age
 * @property string $pt_history
 * @property integer $bd_jili_lu
 * @property integer $bd_jiz_lu
 * @property integer $bd_jiz_ld
 * @property integer $bd_jiz_ru
 * @property integer $bd_jiz_rd
 * @property integer $bd_jili_ld
 * @property integer $bd_jili_ru
 * @property integer $bd_jili_rd
 * @property integer $bd_fanshe_er
 * @property integer $bd_fanshe_san
 * @property integer $bd_fanshe_rao
 * @property integer $bd_fanshe_xi
 * @property integer $bd_fanshe_huai
 * @property integer $bd_zhen_bin
 * @property integer $bd_zhen_huai
 * @property integer $bd_bingli
 * @property integer $bd_hoffman
 * @property integer $bd_zhangai
 * @property integer $bd_xiazhi_zhen
 * @property integer $bd_xiazhi_wei
 * @property string $bd_zhuiti
 * @property integer $bd_gg_zhibi
 * @property integer $bd_gg_genxi
 * @property integer $bd_gg_romberg
 * @property integer $bd_gg_yizi
 * @property string $bd_shenjing
 * @property integer $bd_weisuo_ji
 * @property integer $bd_gongxing
 * @property string $bd_butai
 * @property integer $bd_weisuo_shi
 * @property integer $bd_sesu
 * @property integer $bd_gouyin
 * @property integer $bd_shiyu
 * @property integer $bd_yanzhen
 * @property string $bd_chidai
 * @property string $bd_else
 * @property string $bd_fayu
 */
class ExcelHsp extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'excel_hsp';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['pt_age', 'bd_jili_lu', 'bd_jiz_lu', 'bd_jiz_ld', 'bd_jiz_ru', 'bd_jiz_rd', 'bd_jili_ld', 'bd_jili_ru', 'bd_jili_rd', 'bd_fanshe_er', 'bd_fanshe_san', 'bd_fanshe_rao', 'bd_fanshe_xi', 'bd_fanshe_huai', 'bd_zhen_bin', 'bd_zhen_huai', 'bd_bingli', 'bd_hoffman', 'bd_zhangai', 'bd_xiazhi_zhen', 'bd_xiazhi_wei', 'bd_gg_zhibi', 'bd_gg_genxi', 'bd_gg_romberg', 'bd_gg_yizi', 'bd_weisuo_ji', 'bd_gongxing', 'bd_weisuo_shi', 'bd_sesu', 'bd_gouyin', 'bd_shiyu', 'bd_yanzhen'], 'required'],
            [['pt_age', 'bd_jili_lu', 'bd_jiz_lu', 'bd_jiz_ld', 'bd_jiz_ru', 'bd_jiz_rd', 'bd_jili_ld', 'bd_jili_ru', 'bd_jili_rd', 'bd_fanshe_er', 'bd_fanshe_san', 'bd_fanshe_rao', 'bd_fanshe_xi', 'bd_fanshe_huai', 'bd_zhen_bin', 'bd_zhen_huai', 'bd_bingli', 'bd_hoffman', 'bd_zhangai', 'bd_xiazhi_zhen', 'bd_xiazhi_wei', 'bd_gg_zhibi', 'bd_gg_genxi', 'bd_gg_romberg', 'bd_gg_yizi', 'bd_weisuo_ji', 'bd_gongxing', 'bd_weisuo_shi', 'bd_sesu', 'bd_gouyin', 'bd_shiyu', 'bd_yanzhen'], 'integer'],
            [['pt_history', 'bd_zhuiti', 'bd_shenjing', 'bd_butai', 'bd_chidai', 'bd_else', 'bd_fayu'], 'string', 'max' => 255]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'pk_id' => 'Pk ID',
            'pt_age' => '发病年龄',
            'pt_history' => '现病史',
            'bd_jiz_lu' => '左上肢',
            'bd_jiz_ld' => '左下肢',
            'bd_jiz_ru' => '右上肢',
            'bd_jiz_rd' => '右下肢',
            'bd_jili_lu' => '左上肢',
            'bd_jili_ld' => '左下肢',
            'bd_jili_ru' => '右上肢',
            'bd_jili_rd' => '右下肢',
            'bd_fanshe_er' => '肱二头肌反射',
            'bd_fanshe_san' => '肱三头肌反射',
            'bd_fanshe_rao' => '桡骨膜',
            'bd_fanshe_xi' => '膝反射',
            'bd_fanshe_huai' => '踝反射',
            'bd_zhen_bin' => '髌阵挛',
            'bd_zhen_huai' => '踝阵挛',
            'bd_bingli' => '病理征',
            'bd_hoffman' => 'Hoffman征',
            'bd_zhangai' => '感觉障碍（有无痛触觉障碍）',
            'bd_xiazhi_zhen' => '下肢振动觉',
            'bd_xiazhi_wei' => '下肢关节位置觉',
            'bd_zhuiti' => '锥体外系',
            'bd_gg_zhibi' => '指鼻试验',
            'bd_gg_genxi' => '跟膝胫试验',
            'bd_gg_romberg' => 'Romberg征',
            'bd_gg_yizi' => '一字步',
            'bd_shenjing' => '植物神经功能检查（有无大小便障碍）',
            'bd_weisuo_ji' => '肌萎缩（近端及远端）',
            'bd_gongxing' => '弓形足',
            'bd_butai' => '步态',
            'bd_weisuo_shi' => '视神经萎缩',
            'bd_sesu' => '视网膜色素变性',
            'bd_gouyin' => '构音障碍',
            'bd_shiyu' => '失语',
            'bd_yanzhen' => '眼震',
            'bd_chidai' => '痴呆（智能检查：包括智力、定向力、记忆力）',
            'bd_else' => '其他：皮肤病变（有无鱼鳞病、干皮病、皮肤色素减退）',
            'bd_fayu' => '生长发育（有无身材矮小、骨骼畸形、脊柱侧弯等）',
        ];
    }

    public function defaultValue()
    {
        return ;
    }

    public static function getParams($type = false, $code = false)
    {
        $params = [
            'jizhangli' => ['增高', '减退', '正常'],
            'jianfan' => ['0', '+', '++', '+++', '++++'],
            'yinyang' => ['阳性', '阴性'],
            'youwu' => ['1' => '有', '0' => '无'],
            'yizi' => ['不能', '尚可'],
            'xiazhi_zhen' => ['正常', '减退'],
            'zhibi' => ['稳准', '欠稳准'],
        ];

        if ($code !== false) {
            return ($type) ? $params[$type][$code] : '';
        }

        return ($type) ? $params[$type] : $params;
    }
}
